#include <iostream>
#include <string>
using namespace std;

long long ans;
int n, a, b;
string x;

void maketree (int l, int r, int depth) {
	if (depth < b) {
		return;
	}

	if (r - l > 1) {
		int mid = (l + r - 1) / 2;
		maketree (l, mid + 1, depth - 1);
		maketree (mid + 1, r, depth - 1);
	}

	if (depth > a) return;

	bool B = 1, I = 1;
	for (int i = l; i < r; i++) {
		if (x[i] == '0') {
			I = 0;
		} else if (x[i] == '1') {
			B = 0;
		}
	}

	if (B) {
		ans += 5;
	} else if (I) {
		ans += 2;
	} else {
		ans += 1;
	}
}

int main() {
	cin >> n >> a >> b;
	cin >> x;
	maketree(0, x.size(), n);
	cout << ans << endl;
	return 0;
}
